package org.springblade.task.base.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.task.base.entity.BaseUserReadingDataLog;
import org.springblade.task.base.mapper.BaseUserReadingDataLogMapper;
import org.springblade.task.base.param.BaseUserReadingDataLogParam;
import org.springblade.task.base.service.IBaseUserReadingDataLogService;
import org.springblade.task.base.vo.BaseUserReadingDataLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: TODO
 * @author syncwt
 * @date ${date} ${time}
 * @version V1.0
 */
@Service
public class BaseUserReadingDataLogServiceImpl extends ServiceImpl<BaseUserReadingDataLogMapper, BaseUserReadingDataLog> implements IBaseUserReadingDataLogService {
	@Autowired
	private BaseUserReadingDataLogMapper baseUserReadingDataLogMapper;

	/**
	 * 查询用户阅读、播放时长
	 * @param param
	 * @return
	 */
	@Override
	public List<BaseUserReadingDataLogVO> queryUserReadingDataCount(BaseUserReadingDataLogParam param) {
		return baseUserReadingDataLogMapper.queryUserReadingDataCount(param);
	}

	/**
	 * 查询渠道书籍阅读时长
	 */
	public List<BaseUserReadingDataLogVO> queryChannelReadBookLengthData(BaseUserReadingDataLogParam param) {
		return baseUserReadingDataLogMapper.queryChannelReadBookLengthData(param);
	}

	/**
	 * 查询今日读书用户数据
	 * @param param
	 * @return
	 */
	public List<BaseUserReadingDataLogVO> queryTodayReadBookList(BaseUserReadingDataLogParam param) {
		return baseUserReadingDataLogMapper.queryTodayReadBookList(param);
	}
}
